
package com.idealighter.game.group.handler;

import com.google.inject.Inject;

import com.idealighter.game.core.annotation.ReqMsgHandler;
import com.idealighter.game.group.manager.GroupMgr;
import com.idealighter.game.group.message.ReqCreateGroupMsg;
import com.idealighter.game.message.ModuleMsgIdConstant;
import com.idealighter.game.message.core.ReqMessage;
import com.idealighter.game.message.core.ResMessage;
import com.idealighter.game.player.struct.Player;
import com.idealighter.game.server.handler.ReqMessageHandler;


@ReqMsgHandler(ModuleMsgIdConstant.Group.CREATE_GROUP)
public class ReqCreateGroupHandler implements ReqMessageHandler {

  @Inject
  private GroupMgr groupMgr;

  @Override
  public ResMessage action(Player player, ReqMessage message) {
    ReqCreateGroupMsg msg = (ReqCreateGroupMsg) message;
    return groupMgr.createGroup(player, msg.getGroupName());
  }
}
